<?php
/**
 * @version		$Id: default.php 3 2011-12-16 20:19:15Z netix.mail@gmail.com $
 * @package		ALM Hoster
 * @desription	Web hosting and domain menager for resellers
 * @subpackage	Components
 * @copyright	Copyright (C) 2011 ALM Studio. All rights reserved.
 * @author		ALM Studio
 * @email		info@alm-studio.net
 * @link		http://alm-studio.net
 * @license		Commercial
 */
 
defined('_JEXEC') or die('Restricted Access');
JHtml::_('behavior.tooltip');
JHTML::_('script','system/multiselect.js',false,true);
$listOrder	= $this->escape($this->state->get('list.ordering'));
$listDirn	= $this->escape($this->state->get('list.direction'));
$config = JFactory::getConfig();
$params = JComponentHelper::getParams('com_almhoster');
$currency 	= $params->get("UseCurrency");
?>
<form action="<?php echo JRoute::_('index.php?option=com_almhoster&view=products'); ?>" method="post" name="adminForm">
	<fieldset id="filter-bar">	
		<div class="filter-search fltlft">
			<label class="filter-search-lbl" for="filter_search"><?php echo JText::_('Filter: '); ?></label>
			<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_ALMHOSTER_SEARCH_BY_PRODUCT_NAME'); ?>" />
			<button type="submit"><?php echo JText::_('COM_ALMHOSTER_FILTER'); ?></button>
			<button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('COM_ALMHOSTER_RESET'); ?></button>
		</div>
	</fieldset>
<div class="clr"></div>
<table class="adminlist">
	<thead>
			<tr>
	<th width="5">
		<?php echo JHtml::_('grid.sort',  'Id', 'ProductId', $listDirn, $listOrder); ?>
	</th>
	<th width="10">
		<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->items); ?>);" />
	</th>		
	<th class="title">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_PRODUCT_NAME', 'ProductName', $listDirn, $listOrder); ?>
	</th>
	<th width="13%">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_PRODUCT_HOSTING', 'ProductHosting', $listDirn, $listOrder); ?>
	</th>
	<th width="8%">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_WITH_DOMAIN', 'ProductWithDomain', $listDirn, $listOrder); ?>
	</th>
	<th width="6%">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_PRODUCT_FREE_DOMAIN', 'ProductFreeDomain', $listDirn, $listOrder); ?>
	</th>
	<th width="6%">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_PRODUCT_PRICE_SETUP', 'ProductSetup', $listDirn, $listOrder); ?>
	</th>
	<th width="6%">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_PRODUCT_ACTIVATION', 'ProductActivation', $listDirn, $listOrder); ?>
	</th>
	</tr>
</thead>
<tfoot>	
	<tr>
	<td colspan="11">
		<?php echo $this->pagination->getListFooter(); ?></td>
	</tr>		
</tfoot>
<tbody>
	<?php foreach($this->items as $i => $item): 
?>
	<tr class="row<?php echo $i % 2; ?>">
		<td>
			<?php echo $item->ProductId; ?>
		</td>
		<td>
			<?php echo JHtml::_('grid.id', $i, $item->ProductId); ?>
		</td>
		<td>
		<a href="<?php echo JRoute::_('index.php?option=com_almhoster&task=product.edit&ProductId=' . $item->ProductId); ?>">
				<?php echo $item->ProductName; ?>
				</a>
		</td>
		<td>
			<?php echo $item->ProductHosting; ?>
		</td>
		<td align="center">
			<?php echo JText::_('COM_ALMHOSTER_RADIO_'.$item->ProductWithDomain);?>
		</td>
		<td align="center">
			<?php echo JText::_('COM_ALMHOSTER_RADIO_'.$item->ProductFreeDomain); ?>
		</td>
		<td  align="right">
			<?php echo $item->ProductSetup, JText::_(' '), JText::_('COM_ALMHOSTER_BILLING_CURRENCY_'.$currency); ?>
		</td>
		<td align="center">
			<?php echo JText::_('COM_ALMHOSTER_LIST_ACTIVATION_'.$item->ProductActivation); ?>
		</td>
	</tr>
<?php endforeach; ?>
</tbody>
	</table>
	<div>
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
		<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</form>
